#include <iostream>
#include <string>
using namespace std;

class worker
{
private:
    string ID;
    string name;

public:
    void display()
    {
        cout << "ID:" << ID << endl;
        cout << "Name:" << name << endl;
    }
    worker(string ID, string name) : ID(ID), name(name) {}
};


class teacher : virtual public worker
{
protected:
    float workingTime;
    float salary;

public:
    void display()
    {
        worker::display();
        cout << "Working Time:" << workingTime << "h" << endl;
        cout << "Salary:" << salary << "$" << endl;
    }
    teacher(string ID, string name, float workingTime) : worker(ID, name), workingTime(workingTime)
    {
        salary = 4500 + 50 * workingTime;
    }
};


class student : virtual public worker
{
protected:
    string courses;
    float studyingTime;

public:
    void display()
    {
        worker::display();
        cout << "Courses:" << courses << endl;
        cout << "Studying Time:" << studyingTime << "h" << endl;
    }
    student(string ID, string name, string courses, float studyTime) :
        worker(ID, name), courses(courses), studyingTime(studyTime) {}
};


class teacherAssistant : public teacher, public student
{
public:
    void display()
    {
        worker::display();
        cout << "Working Time:" << workingTime << "h" << endl;
        cout << "Salary:" << salary << "$" << endl;
        cout << "Courses:" << courses << endl;
        cout << "Studying Time:" << studyingTime << "h" << endl;
    }
    teacherAssistant(string ID, string name, float workingTime, string courses, float studyTime) :
        worker(ID, name), teacher(ID, name, workingTime), student(ID, name, courses, studyTime) {}
};


int main()
{
    teacher a("0001", "Wang", 50);
    a.display();
    student b("0002", "Ming", "Math", 3);
    b.display();
    teacherAssistant c("0003", "Li", 10, "English", 2);
    c.display();
    return 0;
}
